#define DEV_DS1307        0xD0

#define DS1307_REG_SEC    0x00
#define DS1307_REG_MIN    0x01
#define DS1307_REG_HOUR   0x02
#define DS1307_REG_DAY    0x03
#define DS1307_REG_DATE   0x04
#define DS1307_REG_MONTH  0x05
#define DS1307_REG_YEAR   0x06
#define DS1307_REG_CTRL   0x07

#define SW_FREQ_1HZ       (0x00 + 0x10)
#define SW_FREQ_4KHZ      (0x01 + 0x10)
#define SW_FREQ_8KHZ      (0x02 + 0x10)
#define SW_FREQ_32KHZ     (0x03 + 0x10)

unsigned char 	DS1307_Present;
char 			DS1307_Init(void);
void 			DS1307_SetDateTime(unsigned char day, unsigned char month, unsigned char year, unsigned char hour, unsigned char min, unsigned char sec);
void 			DS1307_SetWDay(unsigned char day);
void 			DS1307_GetDateTime(unsigned char *day, unsigned char *month, unsigned char *year, unsigned char *hour, unsigned char *min, unsigned char *sec);
void 			DS1307_Freq(unsigned char freq);
void 			DS1307_Output(unsigned char state);
